//void, Obj me, point pt

Hero this;
Unit u;
int i;
point dpt;

Sleep(rand(10)+10);
this = me.AsHero();
if(!.IsValid){ Sleep(rand(100)+10); return; }

.army.ClearDead;
if(.army.count  >= 10){
	if (.race==Carthage || .race==Egypt)
		.PlaySound("data/Sound Entities/VOICESTARAB.XML");
	else if(.race==ImperialRome || .race==RepublicanRome)
		.PlaySound("data/Sound Entities/VOICESTROMAN.XML");
	else if(.race==Gaul || .race==Iberia || .race==Britain || .race==Germany){        
		.PlaySound("data/Sound Entities/VOICESTBARB.XML");
	}
	dpt = GetVecByDir( .GetDir(), 50 );
	.FormSetupAndMoveTo (.pos+dpt, 0, 0, true);
	while (.HasPath ()){
		.FormKeepMoving (1000); 
	}
	for (i = 0; i < .army.count; i += 1){
		u = .army[i].AsUnit;
		Sleep(rand(10)+5);
		if(u.IsValid){
			if(u.command != "stand_position")
				u.SetCommand("stand_position");
		}
	}
		
	.SetCommand("stand_position");

} else {

	for (i = 0; i < .army.count; i += 1){
		Sleep(rand(10)+5);
		if(.army[i].IsValid)
			if(.army[i].command != "stand_position")
				.army[i].SetCommand("stand_position");
	}
	.SetCommand("stand_position");
}



